<?php 
/**
 * Класс, который реализовует базовые настройки PHP-Ext
 *
 */

class FRM_View_Ext_Abstract
{
	/**
	 * Ссиыка для хттппрокси
	 *
	 * @var string
	 */
	protected $url;
	
	/**
	 * Путь к яваскрыпт 
	 *
	 * @var string
	 */
	protected static $js;//= TEMP_JS;
	
	/**
	 * Название контролера
	 *
	 * @var string
	 */
	protected static $controller ='index';
	
	/**
	 * Название екшена
	 *
	 * @var string
	 */
	protected static $action = 'list';
	
	/**
	 * Название модуля (юзер/админ)
	 *
	 * @var string
	 */
	protected static $module = '';
	
	/**
	 * Тайтл
	 *
	 * @var string
	 */
	protected $title = "";
	
	
	/**
	 * Ширина
	 *
	 * @var int
	 */
	protected $width;
	
	/**
	 * Автоширина
	 *
	 * @var string
	 */
	protected $autoWidth;
	
	/**
	 * Высота
	 *
	 * @var int
	 */
	protected $height;	
	
	/**
	 * Высота
	 *
	 * @var int
	 */
	protected $id;
	
	/**
	 * Enter Автовысота
	 *
	 * @var string
	 */
	protected $autoHeight;
	
	/**
	 * Название яваскрипт переменной
	 *
	 * @var string
	 */
	protected $varName;
	
	/**
	 * Язык по умолчанию
	 *
	 * @var string
	 */
	 protected $currentLang = 'ru';
	 
	/**
	 * Языки
	 *
	 * @var array
	 */
	 protected static $langs;
	
	/**
	 * Enter description here...
	 *
	 * @var array
	 */
	protected $items = array();
	
	/**
	 * Enter description here...
	 *
	 * @var int
	 */
	protected $isBodyTwice = 1;
	
	/**
	 * Enter description here...
	 *
	 * @var boolean
	 */
	protected $existTabs = false;
	
	/**
	 * Enter description here...
	 *
	 * @var boolean
	 */
	protected $isWisOnBody = false;
	
	/**
	 * Enter description here...
	 *
	 * @var int
	 */
	protected $isTabTwice = 1;
	
	/**
	 * Enter description here...
	 *
	 * @param string $url
	 */
	public function setUrl ($url){
		$this->url = $url;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param string $js
	 */
	public static  function setJs ($js){
		self::$js = $js;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param string $controller
	 */
	public static  function setController ($controller){
		self::$controller = $controller;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param string $action
	 */
	public static  function setAction ($action){
		self::$action = $action;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param string $module
	 */
	public static  function setModule ($module){
		self::$module = $module;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param string $title
	 */
	public function setTitle ($title){
		$this->title = $title;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param int $width
	 */
	public function setWidth ($width){
		$this->width = $width;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param string $autoWidth
	 */
	public function setAutoWidth ($autoWidth){
		$this->autoWidth = $autoWidth;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param int $height
	 */
	public function setHeight ($height){
		$this->height = $height;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param string $autoHeight
	 */
	public function setAutoHeight ($autoHeight){
		$this->autoHeight = $autoHeight;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param string $currentLang
	 */
	public function setCurrentLang ($currentLang){
		$this->currentLang = $currentLang;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param array $langs
	 */
	public static function setLangs ($langs){
		self::$langs = $langs;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param string $varName
	 */
	public function setVarName ($varName){
		$this->varName = $varName;
	}	
	
	/**
	 * Enter description here...
	 *
	 * @param string $id
	 */
	public function setId ($id){
		$this->id = $id;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param array $items
	 */
	public function setItems($items){
		$this->items = $items;
	}	
	/**
	 * Enter description here...
	 *
	 * @param int $isBodyTwice
	 */
	public function setIsBodyTwice($isBodyTwice){
		$this->isBodyTwice = $isBodyTwice;
	}	
	/**
	 * Enter description here...
	 *
	 * @param boolean $existTabs
	 */
	public function setExistTabs($existTabs){
		$this->existTabs = $existTabs;
	}	
	/**
	 * Enter description here...
	 *
	 * @param boolean $isWisOnBody
	 */
	public function setIsWisOnBody($isWisOnBody){
		$this->isWisOnBody = $isWisOnBody;
	}	
	/**
	 * Enter description here...
	 *
	 * @param int $isTabTwice
	 */
	public function setIsTabTwice($isTabTwice){
		$this->isTabTwice = $isTabTwice;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param string $item
	 */
	public function addItem($item){
		$this->items[] = $item;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param string $controller
	 */
	public static  function getController ($controller){
		return self::$controller;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param string $action
	 */
	public static  function getAction ($action){
		return self::$action;
	}
	
	/**
	 * Enter description here...
	 *
	 * @param string $module
	 */
	public static  function getModule ($module){
		return self::$module;
	}
	
	
	public function preRender(){
		if(is_null($this->url) && !is_null(self::$controller)){
			$this->url = BASE_URL.self::$module.'/'.self::$controller.'/'.self::$action;
		}
	}
}